package com.fable.biz.operate.enums;

import java.util.HashMap;
import java.util.Map;
/**
 * Created by weishuai on 18/5/11.
 */
public enum OrganizationEnum {

    zhonggui("中规", "zhonggui"),
    zhongzhi("中知", "zhongzhi"),
    zhongbiaoyan("中标研", "zhongbiaoyan"),
    nuoya("挪亚", "nuoya"),
    huaxia("华夏", "huaxia"),
    cqc("CQC", "cqc"),
    other("其他", "other")
    ;

    private String desc;
    private String code;

    OrganizationEnum(String desc, String code) {
        this.desc = desc;
        this.code = code;
    }

    public String getDesc() {
        return desc;
    }

    public String getCode() {
        return code;
    }

//    public static OrganizationEnum valueOf(String code) {
//        switch (code) {
//            case "zhonggui":
//                return zhonggui;
//            case "zhongzhi":
//                return zhongzhi;
//            case "zhongbiaoyan":
//                return zhongbiaoyan;
//            case "nuoya":
//                return nuoya;
//            case "huaxia":
//                return huaxia;
//            case "cqc":
//                return cqc;
//            case "other":
//                return other;
//            default:
//                return null;
//        }
//    }


    public static Map<String, String> getMap() {
        Map<String, String> map = new HashMap<>();
        for (OrganizationEnum client : values()) {
            map.put(client.getCode(), client.getDesc());
        }
        return map;
    }
}
